Page({

  /**
   * 页面的初始数据
   */
  data: {
    sts: 0,
    prodList: [],
    title: "",
    current: 1,
    size: 10,
    pages: 0,
    tagid: 0
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    this.setData({
      current: 1,
      pages: 0,
      sts: options.sts,
      title: options.title ? options.title : ""
    });
    if (options.tagid) {
      this.setData({
        tagid: options.tagid
      });
    }

    if (this.data.sts == 0) {
      
    } else if (this.data.sts == 1) {
      wx.setNavigationBarTitle({
        title: '关于我们',
      })
    } else if (this.data.sts == 2) {
      wx.setNavigationBarTitle({
        title: '附近门店',
      })
    } else if (this.data.sts == 3) {
      wx.setNavigationBarTitle({
        title: '案例专区',
      })
    } else if (this.data.sts == 4) {
      wx.setNavigationBarTitle({
        title: '视频专区',
      })
    
    } else {
      wx.setNavigationBarTitle({
        title: this.data.title
      })
    }
    this.loadProdData(options);

  },

  

  getActProd: function(url) {
    var ths = this;
    wx.showLoading();
    var params = {
      url: url,
      method: "GET",
      data: {
        current: ths.data.current,
        size: ths.data.size,
      },
      callBack: function(res) {
        let list = []
        if (res.current == 1) {
          list = res.records
        } else {
          list = ths.data.prodList
          list = list.concat(res.records)
        }
        ths.setData({
          prodList: list,
          pages: res.pages
        });
        wx.hideLoading();
      }
    };
    http.request(params);
  }
})
